package com.ehome.poct.base.api.feign;


import com.ehome.poct.base.api.dto.banner.*;
import com.ehome.poct.base.api.vo.banner.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description:
 * @author: muqiu
 * @time: 2022/3/3 17:26
 */
@FeignClient(value = "${service.poct-base:}${service.suffix.poct-base:}",contextId = "banner")
public interface BannerClient {
    /**
     * banner广告
     * @return
     */
    @GetMapping("/api/banner/list")
    List<BannerVO> list(@RequestParam(value = "deviceType") Integer deviceType);

    /**
     * 广告曝光数增加
     * @param dto
     */
    @PutMapping("/api/banner/incrExposure")
    void incrExposureById(@RequestBody BannerExposureDTO dto);

    /**
     * 广告新增
     * @param bannerDTO
     * @return
     */
    @PostMapping("/api/banner/add")
    Boolean add(BannerDTO bannerDTO);

    /**
     * 广告相关字典数据
     * @return
     */
    @GetMapping("/api/banner/dictData")
    List<BannerDictDataVO> getDictData();

    /**
     * 广告详情列表
     * @return
     */
    @PostMapping("/api/banner/list")
    BannerInfoPageVO getBanners(@RequestBody BannerPageDTO bannerPageDTO);

    /**
     * 编辑回显
     * @param id
     * @return
     */
    @GetMapping("/api/banner/{id}")
    BannerInfoVO getById(@PathVariable(value = "id")Long id);

    /**
     * 广告禁用和启用
     * @param ableDTO
     * @return
     */
    @PutMapping(value = "/api/banner/disable")
    Boolean disable(@RequestBody BannerAbleDTO ableDTO);

    /**
     * 广告删除
     * @param id
     * @return
     */
    @DeleteMapping("/api/banner/delete/{id}")
    Boolean delete(@PathVariable(value = "id")Long id);

    /**
     * 查看数据
     * @param bannerDataDTO
     * @return
     */
    @PostMapping("/api/banner/data")
    BannerDataVO getData(@RequestBody BannerDataDTO bannerDataDTO);
}
